﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ListPreferences.aspx.cs" Inherits="cs499.Preferences.ListPreferences" %>
<%@ MasterType VirtualPath="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content runat="server" ID="navbar" ContentPlaceHolderID="NavOptions">
    <ul>
        <li><asp:LinkButton ID="AddPreferencebutton" runat="server" PostBackUrl="~/Preferences/AddPreference.aspx">Add Preference</asp:LinkButton></li>
        <li><asp:LinkButton ID="DeletePreferencebutton" runat="server" PostBackUrl="~/Preferences/DeletePreferences.aspx">Delete Preference(s)</asp:LinkButton></li>
        <li><asp:LinkButton ID="ChangePasswordbutton" runat="server" PostBackUrl="~/Account/Manage.aspx">Change Password</asp:LinkButton></li>
    </ul>
</asp:Content>
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <h3><asp:Label ID="ListActionMessage" runat="server" Text="" />  List of Preferences For <%: User.Identity.Name %>
                <asp:DropDownList ID="UserDropDownList" runat="server" DataSourceID="ObjectDataSource2" DataTextField="UserName" DataValueField="UserName" Height="28px" Width="155px" OnDataBound="UserDropDownList_DataBound" AutoPostBack="True" OnTextChanged="UserDropDownList_TextChanged">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetUsersInDepartment" TypeName="cs499.Database.ListOfDepartment">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="-1" Name="departmentid" SessionField="CurrentDepartmentId" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </h3>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" OnCallingDataMethods="GridView1_CallingDataMethods" OnDataBinding="GridView1_DataBinding">
        <Columns>
            <asp:BoundField DataField="Course" HeaderText="Course" SortExpression="Course" />
            <asp:BoundField DataField="Room" HeaderText="Room" SortExpression="Room" />
            <asp:BoundField DataField="TimeSlot" HeaderText="TimeSlot" SortExpression="TimeSlot" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPreferences" TypeName="cs499.Database.Faculty">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="-1" Name="departmentid" SessionField="CurrentDepartmentId" Type="Int32" />
            <asp:Parameter DefaultValue="-1" Name="facultyid" Type="Int32" />
            <asp:Parameter DefaultValue="" Name="UserName" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
</asp:Content>
